package com.gitee.dupe.dict.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.dolt.core.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 *
 * </p>
 *
 * @author LYH
 * @since 2020-10-11
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("b_dictionary")
@ApiModel(value = "Dictionary", description = "字典")
public class Dictionary extends Entity<Long> {

    @TableField("type")
    private String type;

    /**
     * 父级
     */
    @TableField("parent_id")
    private Long parentId;


    /**
     * 键
     */
    @TableField("key_")
    private String key;

    /**
     * 值
     */
    @ApiModelProperty(value = "标签", required = true)
    @NotBlank
    @Length(max = 255)
    @TableField("label")
    private String label;

    /**
     * 是否可用
     */
    @ApiModelProperty(value = "是否启用", required = true)
    @TableField(value = "enabled")
    @NotNull
    private Boolean enabled;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    @TableField("sort")
    private Integer sort;



}
